package 强化训练;

import java.util.Scanner;
//未通过
public class day34收件人列表 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int  n = sc.nextInt();
            sc.nextLine();
            for (int i = 0; i < n; i++) {
                String name = sc.nextLine();
                if (name.contains(" ") || name.contains(",")){
                    System.out.print("\"" + name + "\"");
                }else {
                    System.out.print(name);
                }

                if (i == n-1){
                    System.out.println();
                }else {
                    System.out.print(", ");
                }
            }
        }
    }
}
